using System.ComponentModel;

namespace WB.Mvc.Forms
{

	public interface IFieldStrategy
	{
		/// <summary>
		/// Creates a <see cref="Field"/>.
		/// </summary>
		Field Create(string name);
	}

	public interface IModelFieldStrategy: IFieldStrategy
	{
		/// <summary>
		/// Creates a field based on <see cref="PropertyDescriptor" />.
		/// </summary>
		/// <remarks>
		/// It is intended, though not required, that users of this strategy accept
		/// <c>null</c> return values as meaning that this field strategy
		/// does not wish to handle this <see cref="PropertyDescriptor"/>.
		/// </remarks>
		Field Create(PropertyDescriptor descriptor);
	}
}